import axios from '@/request/http'; // 导入http中创建的axios实例

// 系统设置接口

const systemSetup ={
  //////////////// 学生缴费类型设置↓
  // 获取学生缴费类型列表
  GetPaymentTypeList:function(){
    return axios.post('/server/student/payment/type/load/list',{});
  },
  SavePaymentType:function(itemL){
    return axios.post('/server/student/payment/type/save/detail',{itemDetail:JSON.stringify(itemL)});
  },
  //////////////// 学生缴费类型设置↑



  //////////////// 缴费项设置↓
  // 获取缴费项列表
  GetPaymentItemList:function(){
    return axios.post('/server/payment/item/load/list',{});
  },
  // 添加、修改缴费项
  SavePaymentItem:function(fl,itemD){
     return axios.post('/server/payment/item/save/detail',{flag:fl,itemDetail:JSON.stringify(itemD)});
  },
  // 删除缴费项
  DropPaymentItem:function(id){
    return axios.post('/server/payment/item/remove/detail',{itemId:id});
  },
  //////////////// 缴费项设置↑



  //////////////// 缴费方案↓
  GetSearchList:function(searchType,){
    return axios.post(`/server/report/load/search`,{ searchType: searchType})
  },
  // 获取缴费方案列表
  GetPaymentSchemeList:function(pname,ptime,pg){
    return axios.post('/server/payment/project/load/list',{projectName:pname,paymentTimeId:ptime,page:pg});
  },
  // 获取当前缴费项第一步详情
  GetPaymentSchemeDetailOne:function(fg,pid){
    return axios.post('/server/payment/project/load/detail/one',{flag:fg, projectId:pid});
  },
  // 获取当前缴费项第二步详情
  GetPaymentSchemeDetailTwo:function(fg,pid,sid){
    return axios.post('/server/payment/project/load/detail/two',{flag:fg, projectId:pid,schoolId:sid});
  },
  // 保存新增缴费方案第一步
  SaveStepOne:function(fg,st,pj,its,sids,dsids){
    return axios.post('/server/payment/project/save/detail',{flag:fg, saveStep:st,project:JSON.stringify(pj),itemIds:its,schoolIds:sids,deleteSchoolIds:dsids});
  },
  //保存第二部每条的内容
  SaveStepTwoEvery:function(pid,scid,seid,gid,pc,mid,ml){
    return axios.post('/server/payment/project/save/item',{projectId:pid,schoolId:scid,sectionId:seid,gradeId:gid,paymentCategory:pc,moneyId:mid,moneyList:JSON.stringify(ml)});
  },
  // 清除第二部每一项设置
  ClearStepTwoEvery:function(mid){
    return axios.post(`/server/payment/project/remove/item`,{moneyId:mid});
  },
  // 保存第二部完成
  SaveFinshedTwo:function(pid){
    return axios.post('/server/payment/project/save/detail',{saveStep:"2",projectId:pid});
  },
  // 停用
  StopUse:function(fg,pid){
    return axios.post('/server/payment/project/remove/detail',{flag:fg,projectId:pid});
  },
  // 发布前验证
  ReleasePlanBefore:function(pid){
    return axios.post('/server/payment/project/check/publish',{projectId:pid});
  },
  // 发布接口
  ReleasePlan:function(pid){
    return axios.post('/server/payment/project/publish/detail',{projectId:pid});
  },
  //////////////// 缴费方案↑



  //////////////// 权限管理↓
  //获取权限列表
  GetPermissionList:function(uname){
    return axios.post('/server/role/load/list',{userName:uname});
  },
  //获取新增权限人员列表
  GetPeoList:function(){
    return axios.post('/server/role/load/user',{});
  },
  //设置人员权限列表
  SetFinancePeo:function(dir,uid){
    return axios.post('/server/role/save/user',{direction:dir,userId:uid});
  },
  //////////////// 权限管理↑



  //////////////// 电子印章管理↓
  // 获取电子印章列表
  GetElectronicSealList:function(sname,pin){
    return axios.post('/server/payment/seal/load/list',{sealName:sname,page:pin});
  },
  // 获取电子印章列表学校
  GetElectronicSealSchool:function(){
    return axios.post('/server/payment/seal/save/init/school',{});
  },
  //保存电子印章
  SaveElectronicSeal:function(fg,sa,sl){
    return axios.post('/server/payment/seal/save/detail',{flag:fg,seal:JSON.stringify(sa),schoolSeals:JSON.stringify(sl)});
  },
  // 保存电子印章图片
  SaveElectronicSealImg:function(fg,fid,scid,fil){
    return axios.post('/common/file/upload',{fileType:'Seal',flag:fg,fileId:fid,schoolId:scid,file:fil})
  },
  GetElectronicSealDetail:function(sid){
    return axios.post('/server/payment/seal/load/view',{sealId:sid})
  },
  // 删除电子印章
  DropElectronicSeal:function(sid){
    return axios.post('/server/payment/seal/remove/detail',{sealId:sid})
  },
  //////////////// 电子印章管理↑



  //////////////// 收款账户↓
  // 获取收款账户列表
  GetCollectionAccountList:function(tp){
    return axios.post('/server/payment/account/load/account/list',{typeScope:tp});
  },
  // 获取类别列表
  GetCategoryList:function(tsp){
    return axios.post('/server/payment/account/load/type/list',{typeScope:tsp});
  },
  // 添加类别
  AddCategory:function(tname,tsp){
    return axios.post('/server/payment/account/save/type',{typeName:tname,typeScope:tsp});
  },
  // 删除类别
  DropCategory:function(tid){
    return axios.post('/server/payment/account/remove/type',{typeId:tid});
  },
  //添加商户号初始化数据
  InitializationMerchant:function(tp,sid){
    return axios.post('/server/payment/account/load/save/account',{typeScope:tp,schoolId:sid})
  },
  //获取商户号详情
  GetMerchantDetaile:function(sid,tid,tp,seid,mc){
    return axios.post('/server/payment/account/load/account/detail',{schoolId:sid,typeId:tid,typeScope:tp, sectionIds:seid, merchantCode:mc});
  },
  // 保存修改商户号
  SaveMerchant:function(fg,obg){
    return axios.post('/server/payment/account/save/account',{flag:fg,accountDetail:JSON.stringify(obg)});
  },
  // 删除商户号
  DropMerchant:function(sid,tid,mc,seid){
    return axios.post('/server/payment/account/remove/account',{schoolId:sid,typeId:tid,merchantCode:mc,sectionIds:seid});
  },
  //////////////// 收款账户↑



  //////////////// 冻结设置↓
  GetFreezingTime:function(){
    return axios.post('/server/payment/frozen/load/detail',{});
  },
  SetFreezingTime:function(t){
    return axios.post('/server/payment/frozen/save/detail',{time:t});
  },
  //////////////// 冻结设置↑

  //////////////// 操作列表↓
  GetOperationLog:function(pin){
    return axios.post('/server/operate/log/load/list',{page:pin});
  },
  //////////////// 操作列表↑

  //////////////// 年份设置↓
  GetYearsList:function(){
    return axios.post('/server/payment/time/load/list',{});
  },
  SaveYearName:function(Id,tname){
    return axios.post('/server/payment/time/save',{id:Id,timeName:tname});
  }
  //////////////// 操作列表↑

}

export default systemSetup;
